package lab01;

public class Test13 {
    public static void main(String[] args) {
        System.out.println("1~1000之间的水仙花数有：");
        for (int num = 1;num <= 1000;num++) {
            if (num>=100 & num <1000) {
                int hundred = num / 100;
                int decade = num%100 / 10;
                int individual = num%10;
                if (cube(hundred)+cube(decade)+cube(individual) ==num ) {
                    System.out.print(num + " ");
                }
            }
        }
    }
    static int cube(int count) {
        return count*count*count;
    }
}
